package org.demo.tools;

public enum CarStateEnum {

	CAR_STATE_1("1","待租"),
	CAR_STATE_2("2","预定中"),
	CAR_STATE_3("3","服务中"),
	CAR_STATE_4("4","停止服务"),
	CAR_STATE_5("5","停止服务(低电量)");
	
	private String code;
	private String title;

	CarStateEnum(String code, String title) {
		this.code = code;
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public String getTitle() {
		return title;
	}

	public static String getTitle(String code) {
		for (CarStateEnum obj : CarStateEnum.values()) {
			if (obj.getCode().equals(code)) {
				return obj.title;
			}
		}
		return null;
	}
}
